package cn.iocoder.yudao.module.erp.convert.goods;

import cn.iocoder.yudao.module.erp.controller.admin.stock.goods.vo.GoodsRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.goodswarehouselink.vo.GoodsWarehouseLinkRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.goods.GoodsDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface ErpGoodsConvert {
    ErpGoodsConvert INSTANCE = Mappers.getMapper(ErpGoodsConvert.class);
    GoodsRespVO convert(GoodsDO bean);

    @Mapping(target = "warehouseList", source = "goodsWarehouseLinkVOS")
    GoodsRespVO convert(GoodsDO goods, List<GoodsWarehouseLinkRespVO> goodsWarehouseLinkVOS, BigDecimal inventory);
}
